﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Pong
{
    public class PaddleUp:IPaddle
    {
        private Paddle paddle;
        
        public PaddleUp(Paddle paddle)
        {
            this.paddle = paddle;
        }
        
        public void Update(GameTime gameTime)
        {
            if ( Input.DetectKeyUp(Keys.Up))
            {
                this.paddle.IStatePaddle = new PaddleNoMovement(this.paddle);
            }
            this.paddle.Position -= new Vector2(0f, 2f);
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(this.paddle.PaddleTexture,
                this.paddle.Position, this.paddle.Color );
        }
    }
}
